//
//  AFAppDotNetAPIClient.h
//
//  Created by Liulingbo on 15/4/15.
//  Copyright (c) 2015年 Liulingbo. All rights reserved.
//  Descpriton:封装的网络请求。

#import <AFNetworking/AFHTTPSessionManager.h>

typedef void (^HTTPRequestFinishingHandler)(NSDictionary *result, NSError *error);

typedef void (^HTTPRequestFailedHandler)(NSError *error);

@interface CitydoCheckAFAppDotNetAPIClient : AFHTTPSessionManager

//用于字典等转字符串
+ (NSString *)dataTOjsonString:(id)object;


//封装的get请求
+ (void)getAsynchronous:(NSString *)path
              parameter:(NSDictionary *)dic
           successBlock:(HTTPRequestFinishingHandler)successBlock
             errorBlock:(HTTPRequestFailedHandler) errorBlock;

//封装的post请求
+ (void)postAsynchronous:(NSString *)path
               parameter:(id)dic
            successBlock:(HTTPRequestFinishingHandler)successBlock
              errorBlock:(HTTPRequestFailedHandler) errorBlock;
//封装的put请求
+ (void)putAsynchronous:(NSString *)path
              parameter:(id)dic
           successBlock:(HTTPRequestFinishingHandler)successBlock
             errorBlock:(HTTPRequestFailedHandler) errorBlock;

//用于人脸注册
+ (void) upload:(NSString *)path
          image:(UIImage *)data
   successBlock:(HTTPRequestFinishingHandler)successBlock
     errorBlock:(HTTPRequestFailedHandler) errorBlock;

//上传用户名和活体数据至本地 用于人脸检测
+ (void) upload:(NSString *)path
          image:(UIImage *) image
    andLiveData:(NSData *)data
   successBlock:(HTTPRequestFinishingHandler)successBlock
     errorBlock:(HTTPRequestFailedHandler) errorBlock;

//上传音频文件
+ (void) uploadAudioFile:(NSString *)path
                  params:(NSDictionary*)params
                    data:(NSData *)data
            successBlock:(HTTPRequestFinishingHandler)successBlock
              errorBlock:(HTTPRequestFailedHandler) errorBlock;
//上传人脸
+ (void) uploadFaceFile:(NSString *)path
                 params:(NSDictionary*)params
                   data:(UIImage *)data
           successBlock:(HTTPRequestFinishingHandler)successBlock
             errorBlock:(HTTPRequestFailedHandler) errorBlock;
//sensetime 上传文件
+ (void) upload:(NSString *)path
      imageFile:(UIImage *)data
   successBlock:(HTTPRequestFinishingHandler)successBlock
     errorBlock:(HTTPRequestFailedHandler) errorBlock;

//Sensetime活体数据和图片上传
+ (void) postImage:(NSString *)path
             image:(UIImage *) image
              data:(NSData *)data
      successBlock:(HTTPRequestFinishingHandler)successBlock
        errorBlock:(HTTPRequestFailedHandler) errorBlock;

@end
